package com.questionnaires.repository;

import com.questionnaires.model.User;
import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

/**
 * Created by IntelliJ IDEA.
 * User: Ioana
 * Date: 1/16/12
 * Time: 9:22 PM
 * To change this template use File | Settings | File Templates.
 */
@Repository
public class UserRepositoryImpl implements UserRepository {

    @Autowired
    private SessionFactory sessionFactory;

    @Transactional
    public void addUser(User user) {

        sessionFactory.getCurrentSession().save(user);
    }
}
